//
//  MASExampleRatioView.m
//  MasonryExample
//
//  Created by 山刘 on 2020/6/10.
//  Copyright © 2020 山刘. All rights reserved.
//

#import "MASExampleRatioView.h"

@implementation MASExampleRatioView
- (id)init {
    self = [super init];
    if (!self) return nil;
    
    UIView *view = [LayoutUtils createView];
    [self addSubview:view];
    
    [view makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self);
        make.width.equalTo(view.mas_height).multipliedBy(2); // width = height*2 ==> height = width/2
        //make.height.equalTo(view.mas_width).dividedBy(2);// height = width/2
        make.width.and.height.equalTo(self).width.priorityLow();
    }];
    return self;
}
@end
